﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default : PageBase
{
    protected void Page_Load( object sender, EventArgs e )
    {
        LabelLoginStatus.Text = Config.LabelLoginStatusText;
        LabelLoginView.Text = Config.LabelLoginViewText;
        HyperLinkPageSecurisee.NavigateUrl = Config.PageSecurisee;

        if ( !Page.IsPostBack )
        {
            if ( User.Identity.IsAuthenticated )
            {
                HyperLinkChangePassword.Visible = true;
                HyperLinkChangePassword.NavigateUrl = "~/ChangePasswordPage.aspx";
                HyperLinkChangePassword.Text = Resources.labels.HyperLinkChangePasswordText + "<br>";

                HyperLinkEditProfile.Visible = true;
                HyperLinkEditProfile.NavigateUrl = "~/EditProfile.aspx";
                HyperLinkEditProfile.Text = Resources.labels.HyperLinkEditProfileText + "<br>";
            }

            if ( User.IsInRole( "Administrateur" ) )
            {
                HyperLinkCreateRole.Visible = true;
                HyperLinkCreateRole.NavigateUrl = "~/CreateRole.aspx";
                HyperLinkCreateRole.Text = Resources.labels.HyperLinkCreateRoleText + "<br>";
            }
        }
    }
}
